]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
location: Make _connectToGeoclue() reentrent
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 15:17:58 +0000 (15:17 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 15 Feb 2014 17:41:26 +0000 (17:41 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=723684

js/ui/status/location.js

index bc42a4e1d4d65835c7d1f2811162003e1a90d29c..b14bd8abb079bdb191af3e231b41df94db9d7c3d 100644 (file)
@@ -41,13 +41,19 @@ const Indicator = new Lang.Class({
     },
 
     _connectToGeoclue: function() {
+        if (this._proxy != null || this._connecting)
+            return false;
+
+        this._connecting = true;
         new GeoclueManager(Gio.DBus.system,
                            'org.freedesktop.GeoClue2',
                            '/org/freedesktop/GeoClue2/Manager',
                            Lang.bind(this, this._onProxyReady));
+        return true;
     },
 
     _onProxyReady: function (proxy, error) {
+        this._connecting = false;
         if (error != null) {
             log (error.message);
             return;